package org.meteorshower.employee_depart.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 地区类，映射完成
 * @table locate
 * */
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Data
@TableName("locate")
public class Locate implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableField("code")
    private String code;
    @TableField("name")
    private String name;
    @TableField("parent_code")
    private String parentCode;
    @TableField("level")
    private Integer level;
    @TableField(exist = false)
    private String details;
    @TableField(exist = false)
    private Integer levelCount;
    @TableField(exist = false)
    private Locate childPlace=null;
    @TableField(exist = false)
    private String nativePlace;
    @TableField(exist = false)
    private String address;

//    public String LocateParser() {
//        StringBuffer sb = new StringBuffer();
//        return parser(sb, this).toString();
//    }
//    private StringBuffer parser(StringBuffer sb, Locate childPlace) {
//        if (childPlace == null){
//            return sb.delete(sb.length()-1, sb.length());
//        }else{
//            sb.insert(0,childPlace.getName()+"/");
//            return parser(sb, childPlace.getChildPlace());
//        }
//    }
}
